package com.example.yian.service;

import com.example.yian.entity.RiskRectification;
import com.example.yian.entity.SecurityRisk;
import com.example.yian.mapper.RiskRectificationMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class RiskRectificationService {

    @Autowired
    private RiskRectificationMapper riskRectificationMapper;
    public RiskRectification addRiskRectification(Long riskId, String image, String rectificationContent) {
        RiskRectification riskRectification = new RiskRectification();
        riskRectification.setRiskId(riskId);
        riskRectification.setImage(image);
        riskRectification.setRectificationContent(rectificationContent);
        riskRectificationMapper.insert(riskRectification);
        return riskRectification;
    }

    public RiskRectification getRectificationByRiskId(Long riskId) {
        return riskRectificationMapper.selectRectificationByRiskId(riskId);
    }
}
